<?php require_once('Connections/dis01.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_dis01, $dis01);
$query_ls_versiculo = "SELECT verso_id, verso_descricao FROM versiculos ORDER BY verso_id DESC";
$ls_versiculo = mysql_query($query_ls_versiculo, $dis01) or die(mysql_error());
$row_ls_versiculo = mysql_fetch_assoc($ls_versiculo);
$totalRows_ls_versiculo = mysql_num_rows($ls_versiculo);

mysql_select_db($database_dis01, $dis01);
$query_ls_msg = "SELECT msg_id, msg_titulo FROM mensagem ORDER BY msg_titulo ASC";
$ls_msg = mysql_query($query_ls_msg, $dis01) or die(mysql_error());
$row_ls_msg = mysql_fetch_assoc($ls_msg);
$totalRows_ls_msg = mysql_num_rows($ls_msg);

$colname_ls_msg02 = "-1";
if (isset($_POST['titulo'])) {
  $colname_ls_msg02 = $_POST['titulo'];
}
mysql_select_db($database_dis01, $dis01);
$query_ls_msg02 = sprintf("SELECT msg_id, msg_dt, msg_titulo, msg_resumo, msg_descricao, msg_autot FROM mensagem WHERE msg_id = %s", GetSQLValueString($colname_ls_msg02, "int"));
$ls_msg02 = mysql_query($query_ls_msg02, $dis01) or die(mysql_error());
$row_ls_msg02 = mysql_fetch_assoc($ls_msg02);
$totalRows_ls_msg02 = mysql_num_rows($ls_msg02);
?>

<!DOCTYPE HTML5>
<html lang="pt-br">
<head>
<meta http-equiv="Content-Type" content="text/html; charset= UTF-8" />
<title>Disseminando.com</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="templatemo_style.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet" href="css/orman.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/nivo-slider.css" type="text/css" media="screen" />	

<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/ddsmoothmenu.js">

</script>

<script type="text/javascript">

ddsmoothmenu.init({
	mainmenuid: "templatemo_menu", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})

</script>

<link rel="stylesheet" href="css/slimbox2.css" type="text/css" media="screen" /> 
<script type="text/JavaScript" src="js/slimbox2.js"></script> 

</head>
<body id="subpage">

<div id="templatemo_wrapper">
	<div id="templatemo_header">
    	<div id="site_title"><img src="images/logo_projeto.png" width="296" height="76" /></div>
        <div id="templatemo_menu" class="ddsmoothmenu">
            <ul>
                <li><a href="index.php">Home</a></li>
                <li><a href="publicacao1001.php" class="selected">Publicação</a></li>
                <li><a href="#">Consulta</a>
                    <ul>
                        <li><a href="#">Evangelismo</a></li>
                        <li><a href="#">Diversos</a></li>
                        <li><a href="cs_msg1002.php">Mensagem</a></li>
                  </ul>
                </li>
                <li><a href="contato.php">Contato</a></li>
            </ul>
            <br style="clear: left" />
        </div> <!-- end of templatemo_menu -->
    </div> <!-- END of header -->
    
    <div id="templatemo_page_intro">
    	<h1>Versiculo do Dia</h1>
        <p><?php echo $row_ls_versiculo['verso_descricao']; ?></p>
    </div>
    
    
    <div id="templatemo_main">
      <div class="clear">
        <form name="form1" method="post" action="">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="156" colspan="2"><img src="images/blog/palavra01.jpg" alt="" width="555" height="142"></td>
            </tr>
            <tr>
              <td width="21%"><strong>Pesquisar Mensagem :</strong></td>
              <td width="79%"><label>
                <select name="titulo" id="titulo">
                  <?php
do {  
?>
                  <option value="<?php echo $row_ls_msg['msg_id']?>"><?php echo $row_ls_msg['msg_titulo']?></option>
                  <?php
} while ($row_ls_msg = mysql_fetch_assoc($ls_msg));
  $rows = mysql_num_rows($ls_msg);
  if($rows > 0) {
      mysql_data_seek($ls_msg, 0);
	  $row_ls_msg = mysql_fetch_assoc($ls_msg);
  }
?>
                </select>
                <input type="submit" name="p" id="p" value="Pesquisar">
              </label></td>
            </tr>
          </table>
        </form>
        <p></p>
        <p>&nbsp;</p>
        <p><strong><font size="3">Leia atentamente essa mensagem :</font></strong></p>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="16%" height="24">Publicada em :</td>
            <td width="84%"><?php echo $row_ls_msg02['msg_dt']; ?></td>
          </tr>
          <tr>
            <td height="25" valign="top">Titulo :</td>
            <td valign="top"><?php echo $row_ls_msg02['msg_titulo']; ?></td>
          </tr>
          <tr>
            <td height="42" valign="top">Resumo :</td>
            <td valign="top"><font color="#FF0000"><?php echo $row_ls_msg02['msg_resumo']; ?></font></td>
          </tr>
          <tr>
            <td height="25" valign="top">Mensagem :</td>
            <td valign="top"><p align="justify"><?php echo $row_ls_msg02['msg_descricao']; ?></p></td>
          </tr>
          <tr>
            <td height="26">Autor :</td>
            <td><?php echo $row_ls_msg02['msg_autot']; ?></td>
          </tr>
        </table>
        <p>&nbsp;</p>
      </div>       
  </div> <!-- END of content -->
        <div class="clear"></div>                
</div> <!-- END of main -->
</div> <!-- END of wrapper -->

<div id="templatemo_bottom_wrapper">
	<div id="templatemo_bottom">
    	
        <div class="col col_3">
          <iframe frameborder="0" marginwidth="0" marginheight="0" scrolling="No" width="100%" height="30" style= "position: fixed; top: 0%; left: 0%;height: 6%;width: 100%;" src="http://streaming15.hstbr.net/player/radiogospeladoradores"></iframe>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div> <!-- END of bottom -->
    
</div> <!-- END of bottom wrapper -->

<div id="templatemo_footer_wrapper">
	<div id="templatemo_footer">
    	 <?php include('rodape.php') ?>
    </div> <!-- END of footer -->
</div> <!-- END of footer wrapper -->

</body>
</html>
<?php
mysql_free_result($ls_versiculo);

mysql_free_result($ls_msg);

mysql_free_result($ls_msg02);
?>
